Linux webm002.cluster126.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
/
home
/
ariannadhf
/
www
/
wp-content
/
plugins
/
admin-menu-editor
/
customizables
/
Settings
/
/home/ariannadhf/www/wp-content/plugins/admin-menu-editor/customizables/Settings/BooleanSetting.php
<?php namespace YahnisElsts\AdminMenuEditor\Customizable\Settings; /** * @deprecated */ class BooleanSetting extends Setting { protected $dataType = 'boolean'; public function validate($errors, $value, $stopOnFirstError = false) { if ( $this->canTreatAsNull($value) ) { return null; } $value = $this->tryConvertToBool($value); if ( $value === null ) { $errors->add('not_boolean', 'Value must be a boolean (true or false)'); return $errors; } return $value; } /** * @param mixed $value * @return bool|null */ protected function tryConvertToBool($value) { if ( is_string($value) ) { //Handle values like "on", "off", "false", etc. return filter_var(strtolower($value), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); } else if ( $value !== null ) { return boolval($value); } return null; } }